package com.It;

import java.util.Scanner;
public class test4{
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);//从键盘输入
        System.out.print("请输入你要打印三角形的行数:");
        int n=sc.nextInt();
        int i,j,k,a;
        for(i=1;i<=n;i++)
        {
            for(j=1;j<=n-i;j++)
                System.out.print(" ");
            for(k=1;k<=i;k++)
                System.out.print(k);
            for(a=i-1;a>=1;a--)
                System.out.print(a);
            System.out.println();//换行
        }
    }
}
